package com.bytedance.frameworks.core.encrypt;

public class TTEncryptUtils {
    static {
        try {
            System.loadLibrary("ttEncrypt");
        } catch (UnsatisfiedLinkError v0) {
            v0.printStackTrace();
        }
    }

    public static byte[] encryptBytes(byte[] bytes, int length) {
        if (bytes != null && length > 0) {
            try {
                if (bytes.length == length) {
                    return TTEncryptUtils.ttEncrypt(bytes, length);
                } else {
                    return null;
                }
            } catch (Throwable throwable) {
            }
        }
        return null;
    }

    private static native byte[] ttEncrypt(byte[] bytes, int length);
}

